/*
//此函数执行会返回一个数组，数组里面包含所有好友的聊天信息
function createFriendList() {
    return [
        {
            friend: 'xiaohong',
            chatInfo: ['ChatTime'],
            messages: [
                {initiator: 'xiaomin', message: '喂，小红在干嘛', sendTime: 1233445}
            ]
        },
        {
            friend: 'xiaogang',
            chatInfo: ['ChatTime', 'ChatTime', 'ChatMessageLeft', 'ChatMessageRight', 'ChatTime', 'ChatMessageLeft', 'ChatMessageRight'],
            messages: [
                {initiator: 'xiaomin', message: '喂，小刚在干嘛', sendTime: 1233445}
            ]
        },
        {
            friend: 'xiaodong',
            chatInfo: ['ChatTime', 'ChatTime', 'ChatTime', 'ChatTime', 'ChatTime'],
            messages: [
                {initiator: 'xiaomin', message: '喂，小东在干嘛', sendTime: 1233445}
            ]
        },
    ]
}

//对外暴露一个数组，数组里面包含两个接口，用于获取好友信息的假接口
export default [
    //获取所有信息接口
    {
        url: '/api/friend/get',  //请求地址
        method: 'get',  //请求方式
        response: (request: any) => {
            let allMessage = createFriendList()
            return { code: 200, data: allMessage }
        },
    },
    //发送信息接口
    {
        url: '/api/friend/send',  //请求地址
        method: 'post',  //请求方式
        response: ({ body }: any) => {
            //获取请求体携带过来的好友消息
            let { initiator, friend, message, sendTime } = body
            //chatting.chatInfo.infoList.push('ChatTime')
            //获取正在聊天的好友用户名
            let info = createFriendList().find((item) => item.freind === friend)
            return { code: 200, data: info }
        },
    },
]*/
